<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="template.xhtml"> 
	<ui:define name="content">

		<h:head>
			<title>Game of Thrones</title>
		</h:head>

		<h:body>
			<f:view>
				<h:form id="houseTable">
					<p:dataGrid var="myHouse" value="#{houseList.houses}" columns="3"
						rows="12" paginator="false" rowsPerPageTemplate="9,12,15">
						<p:panel header="#{myHouse.name}" style="text-align:center">
							<p:commandLink action="#{goTController.queryHouseInformation}">
								<h:panelGrid columns="1" style="width:100%">
									<p:graphicImage value="#{myHouse.iconLocation}"
										style="width:100%"></p:graphicImage>
								</h:panelGrid>
							  	<f:setPropertyActionListener target="#{houseList.selectedHouse}"
									value="#{myHouse}"></f:setPropertyActionListener>
							</p:commandLink>
						</p:panel>
					</p:dataGrid>
				</h:form>
			</f:view>
		</h:body>
 	</ui:define>
</ui:composition>
</html>